// pages/pay/payDone/done/index.js
import { sendServer } from '../../../request/common.js'
Page({

  /**
   * 页面的初始数据
   */
  data: {
    orderId:'',
    // tempfilePath:'http://localhost:8080/img/',
    tempfilePath:'http://192.168.0.103:8080/img/',
    itemList:[],
    orderInfo:{
    },
  },
  onUnload: function () {    
    wx.reLaunch({     
        url: '/pages/index/index'   
    }) 
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let orderId=options.orderId
    this.setData({
      orderId:orderId
    })
    this.getOrderDetail(orderId)
  },

  
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  getOrderDetail(id){
    let params={},send={};
    send.orderId=this.data.orderId,
    params.send=send;
    params.url='order/showOrderDetail'
    sendServer(params,(commRes)=>{
      console.log(commRes)
        if(commRes.code==100){
          this.setData({
            itemList:commRes.extend.order.orderItemList,
            orderInfo:commRes.extend.order
          })
        }
    })

  }
})